<?php

require_once('db/db.php');

$db=new DB;

function check($name){
    if(isset($_REQUEST[$name])){
        return $_REQUEST[$name];
    }
    else{
        die();
    }
}

$id=intval(check('id'));

$sql="delete from `ad` where `id`=$id";

if(!$db->query($sql)){
    return false;
}

echo json_encode(array('success'=>true));

?>
